﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:helpers="clr-namespace:JetPackWPFTheme.Helpers" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

    <!-- Global Settings. -->
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Brushes.xaml" />
        <ResourceDictionary Source="Fonts.xaml" />
        <ResourceDictionary Source="CoreStyles.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!-- Redefine this brush for new color variations -->
    <LinearGradientBrush x:Key="TreeViewItemSelectionBorder" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFBED126" Offset="0" />
        <GradientStop Color="#2626292F" Offset="1" />
    </LinearGradientBrush>

    <!---->

   <!-- 
	***************************************************************************
	DescriptionViewer
	***************************************************************************
	-->

    <!--<Style TargetType="DescriptionViewer">
	<Setter Property="IsTabStop" Value="False"/>
	<Setter Property="GlyphTemplate">
		<Setter.Value>
			<ControlTemplate TargetType="Button">
				<Grid>
					<VisualStateManager.VisualStateGroups>
						<VisualStateGroup x:Name="CommonStates">
							<VisualState x:Name="Normal"/>
							<VisualState x:Name="MouseOver">
								<Storyboard>
									<DoubleAnimation Duration="0" To="1"
Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Icon"/>
								</Storyboard>
							</VisualState>
							<VisualState x:Name="Pressed">
								<Storyboard>
									<DoubleAnimation Duration="0" To="1"
Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Icon"/>
								</Storyboard>
							</VisualState>
							<VisualState x:Name="Disabled"/>
						</VisualStateGroup>
					</VisualStateManager.VisualStateGroups>
					<Grid x:Name="Icon" HorizontalAlignment="Center" Opacity="0.8"
VerticalAlignment="Center" >
						<Ellipse Width="16" Height="16" Fill="#34acd9">
							<Ellipse.Effect>
								<DropShadowEffect BlurRadius="3" ShadowDepth="1"
Direction="-90" Color="Black" Opacity="0.5" />
							</Ellipse.Effect>
						</Ellipse>
						<Path Width="12" Height="12" Stretch="Fill" Fill="#FFFFFF"
Data="F1 M 395.999,176.127C 333.109,176.127 282.128,227.109 282.128,290C 282.128,352.891 333.109,403.873 395.999,403.873C
458.891,403.873 509.872,352.891 509.872,290C 509.872,227.109
458.891,176.127 395.999,176.127 Z M 397.915,194.443C 410.167,194.443
420.669,204.945 420.669,217.197C 420.669,229.699 410.167,240.201 397.915,240.201C 385.663,240.201 375.161,229.699 375.161,217.197C
375.161,204.945 385.663,194.443 397.915,194.443 Z M 437.421,374.472C
426.92,374.472 409.667,373.222 397.665,373.222C 385.913,373.222
371.661,374.472 361.16,374.472C 360.16,374.472 359.158,370.972 359.158,368.972C 359.158,367.222 360.16,363.721 361.16,363.471C
373.161,362.22 378.162,358.22 378.162,342.467L 378.162,304.961C
378.162,291.709 373.161,288.959 361.16,287.959C 360.16,287.709
359.158,284.458 359.158,282.707C 359.158,280.957 360.16,277.457 361.16,277.457C 377.412,274.206 400.166,264.955 411.417,259.704C
412.417,259.203 414.917,257.703 416.919,257.703C 420.919,257.703
422.669,259.203 422.419,260.954C 421.919,271.206 420.419,290.209 420.419,303.211L 420.419,342.467C 420.419,358.22 425.42,362.22 437.421,363.471C 438.421,363.721 439.423,367.222 439.423,368.972C
439.423,370.972 438.421,374.472 437.421,374.472 Z "/>
					</Grid>
				</Grid>
			</ControlTemplate>
		</Setter.Value>
	</Setter>
	<Setter Property="Template">
		<Setter.Value>
			<ControlTemplate TargetType="DescriptionViewer">
				<StackPanel Orientation="Horizontal">
					<VisualStateManager.VisualStateGroups>
						<VisualStateGroup x:Name="DescriptionStates">
							<VisualState x:Name="NoDescription"/>
							<VisualState x:Name="HasDescription">
								<Storyboard>
									<ObjectAnimationUsingKeyFrames Duration="0"
Storyboard.TargetProperty="Visibility"
Storyboard.TargetName="DescriptionContent">
										<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
									</ObjectAnimationUsingKeyFrames>
								</Storyboard>
							</VisualState>
						</VisualStateGroup>
					</VisualStateManager.VisualStateGroups>
					<Border BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}" Height="{TemplateBinding Height}" Padding="{TemplateBinding Padding}" Width="{TemplateBinding Width}">
						<Button x:Name="DescriptionContent" BorderBrush="#FFFFFFFF"
BorderThickness="1" Background="#00000000"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
IsTabStop="False" Padding="1" Template="{TemplateBinding GlyphTemplate}" Visibility="Collapsed"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
							<ToolTipService.ToolTip>
								<ToolTip Placement="Right" IsHitTestVisible="False" Margin="5,-3,5,0" Content="{TemplateBinding Description}" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" />
							</ToolTipService.ToolTip>
						</Button>
					</Border>
				</StackPanel>
			</ControlTemplate>
		</Setter.Value>
	</Setter>
</Style>-->

    <!-- 
	***************************************************************************
	OpacityButton (helper style used by other controls)
	***************************************************************************
	-->

    <Style x:Key="OpacityButton" TargetType="Button">
        <Setter Property="Padding" Value="0" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="Root" Background="Transparent">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.2" />
                                    <VisualTransition GeneratedDuration="0" From="Pressed" />
                                    <VisualTransition GeneratedDuration="0" To="Pressed" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="Translater" Storyboard.TargetProperty="Y" To="1" />
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="ContentSite" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="ContentSite" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.25" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="ContentSite" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter x:Name="ContentSite" Opacity="0.5" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <ContentPresenter.RenderTransform>
                                <TranslateTransform Y="0" x:Name="Translater" />
                            </ContentPresenter.RenderTransform>
                        </ContentPresenter>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	TreeView (including TreeViewItem)
	***************************************************************************
	-->

    <Style TargetType="TreeViewItem">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Cursor" Value="Arrow" />
        <Setter Property="Foreground" Value="{StaticResource ControlForegroundGreen}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="IsTabStop" Value="True" />
        <Setter Property="Padding" Value="4" />
        <Setter Property="KeyboardNavigation.ControlTabNavigation" Value="Once" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TreeViewItem">
                    <Grid Background="{x:Null}" Margin="{TemplateBinding Padding}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="9" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_Header" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Selection" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SelectedInactive">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Selection" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="HasItemsStates">
                                <VisualState x:Name="HasItems" />
                                <VisualState x:Name="NoItems">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ExpanderButton">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ExpansionStates">
                                <VisualState x:Name="Collapsed" />
                                <VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ItemsHost">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Validation">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Validation">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="ValidationToolTip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>True</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ToggleButton x:Name="ExpanderButton" Height="9" IsTabStop="False" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" KeyboardNavigation.ControlTabNavigation="Once" VerticalAlignment="Stretch">
                            <ToggleButton.Template>
                                <ControlTemplate TargetType="ToggleButton">
                                    <Grid x:Name="Root" Background="Transparent">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="MouseOver" />
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To=".7" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="CheckStates">
                                                <VisualState x:Name="Unchecked" />
                                                <VisualState x:Name="Checked">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="UncheckedVisual" />
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CheckedVisual" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Grid>
                                            <Border CornerRadius="1">
                                                <Border.Effect>
                                                    <DropShadowEffect Color="#55524f" ShadowDepth="2" BlurRadius="3" Opacity="0.5" />
                                                </Border.Effect>
                                                <Border.Background>
                                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                        <GradientStop Color="#ffffff" Offset="0" />
                                                        <GradientStop Color="#cccccc" Offset="1" />
                                                    </LinearGradientBrush>
                                                </Border.Background>
                                            </Border>
                                            <Path x:Name="UncheckedVisual" Width="5" Height="5" StrokeThickness="1" Stroke="Black" Data="M0,2.5 L5,2.5 M2.5,0 L2.5,5" Stretch="None" />
                                            <Path x:Name="CheckedVisual" Opacity="0" Width="5" Height="5" StrokeThickness="1" Stroke="Black" Data="M0,2.5 L5,2.5" Stretch="None" />
                                        </Grid>
                                    </Grid>
                                </ControlTemplate>
                            </ToggleButton.Template>
                        </ToggleButton>
                        <Border x:Name="Selection" Grid.Column="1" Margin="2,-4,-6,-4" Background="{StaticResource InputSelectionBrush}" BorderBrush="{StaticResource ColorAccentHighlightBrush}" CornerRadius="1" BorderThickness="0,1,0,0" Opacity="0" Effect="{StaticResource LightControlShadowEffect}" />
                        <Button x:Name="PART_Header" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Cursor="{TemplateBinding Cursor}" ClickMode="Hover" Grid.Column="1" Foreground="{TemplateBinding Foreground}" Margin="8,0,0,0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" KeyboardNavigation.ControlTabNavigation="Once" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Grid Background="{TemplateBinding Background}">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="Pressed" />
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Content" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <ContentPresenter x:Name="Content" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="Left" Margin="0" />
                                    </Grid>
                                </ControlTemplate>
                            </Button.Template>
                            <ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" />
                        </Button>
                        <Border x:Name="Validation" BorderBrush="{StaticResource ErrorBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" Grid.Column="1" Margin="4,-2,-4,-2" Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="ValidationToolTip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" IsHitTestVisible="True" Placement="Right" PlacementTarget="{Binding ElementName=PART_Header}" Template="{StaticResource ValidationToolTipTemplate}" />
                            </ToolTipService.ToolTip>
                            <Grid Background="Transparent" HorizontalAlignment="Right" Height="10" Margin="0,-4,-4,0" VerticalAlignment="Top" Width="10">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 Z" Fill="{StaticResource ErrorBrush}" Margin="-1,3,0,0" />
                            </Grid>
                        </Border>
                        <ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1" Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="TreeView">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Cursor" Value="Arrow" />
        <Setter Property="Foreground" Value="{StaticResource ControlForegroundGreen}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="IsTabStop" Value="True" />
        <Setter Property="Padding" Value="1" />
        <Setter Property="KeyboardNavigation.ControlTabNavigation" Value="Once" />
        <Setter Property="VerticalContentAlignment" Value="Top" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TreeView">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Validation">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="Validation">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="ValidationToolTip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>True</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
                            <Border Background="{TemplateBinding Background}" Margin="1" Padding="{TemplateBinding Padding}">
                                <ScrollViewer x:Name="ScrollViewer" BorderBrush="Transparent" BorderThickness="0" Background="{x:Null}" IsTabStop="False" KeyboardNavigation.ControlTabNavigation="Once" CanContentScroll="false" Focusable="false" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
                                    <ItemsPresenter />
                                </ScrollViewer>
                            </Border>
                        </Border>
                        <Border x:Name="Validation" BorderBrush="{StaticResource ErrorBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="1" CornerRadius="2" Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="ValidationToolTip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" IsHitTestVisible="True" Placement="Right" PlacementTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Template="{StaticResource ValidationToolTipTemplate}" />
                            </ToolTipService.ToolTip>
                            <Grid Background="Transparent" HorizontalAlignment="Right" Height="10" Margin="0,-4,-4,0" VerticalAlignment="Top" Width="10">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 Z" Fill="{StaticResource ErrorBrush}" Margin="-1,3,0,0" />
                                <Path Data="M 0,0 L2,0 L 8,6 L8,8" Fill="#FFFFFFFF" Margin="-1,3,0,0" />
                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	DatePicker (including DatePickerTextBox and DropDownButton)
	***************************************************************************
	-->

    <ControlTemplate x:Key="DateDropDownButtonTemplate" TargetType="Button">
        <Grid FlowDirection="LeftToRight">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualStateGroup.Transitions>
                        <VisualTransition GeneratedDuration="0" />
                        <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver" />
                        <VisualTransition GeneratedDuration="0:0:0.1" To="Pressed" />
                    </VisualStateGroup.Transitions>
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0" />
                            <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Pressed">
                        <Storyboard>
                            <DoubleAnimation Duration="0" Storyboard.TargetName="NormalElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0.25" />
                            <DoubleAnimation Duration="0" Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                            <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0" />
                            <DoubleAnimation Duration="0" Storyboard.TargetName="HighlightElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0.5" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames BeginTime="0" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="DisabledVisual">
                                <SplineDoubleKeyFrame KeyTime="0" Value="1" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Grid Width="26" Height="24" VerticalAlignment="Top">
                <Border CornerRadius="1">
                    <Border.Background>
                        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                            <GradientStop Color="#FFFFFFFF" Offset="0.65" />
                            <GradientStop Color="#FFF2F2F2" Offset="0.90" />
                            <GradientStop Color="#FFDADADA" Offset="1" />
                        </LinearGradientBrush>
                    </Border.Background>
                    <Border.Effect>
                        <DropShadowEffect Color="#55524f" ShadowDepth="2" BlurRadius="3" Opacity="0.5" />
                    </Border.Effect>
                </Border>
                <Border x:Name="NormalElement" Height="6" VerticalAlignment="Top" CornerRadius="1,1,0,0" Background="{StaticResource ControlBackgroundNormalGreen}" />
                <TextBlock Text="16" FontSize="14" Foreground="#FF292D2F" FontWeight="Bold" FontFamily="Arial" Margin="0,6,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" />
                <Border x:Name="MouseOverElement" Height="6" Background="{StaticResource ControlBackgroundOverGreen}" CornerRadius="2,2,0,0" Opacity="0" VerticalAlignment="Top" />
                <Border x:Name="PressedElement" Height="6" Background="{StaticResource ControlBackgroundPressedGreen}" CornerRadius="2,2,0,0" Opacity="0" VerticalAlignment="Top" />
                <Border x:Name="HighlightElement" Height="6" BorderBrush="{StaticResource HighlightBrushGreen}" BorderThickness="0.5,1,0,0" CornerRadius="1,1,0,0" VerticalAlignment="Top" />
                <Border x:Name="DisabledVisual" Background="{StaticResource DisabledBrush}" CornerRadius="1,1,0,0" Opacity="0" />
            </Grid>
        </Grid>
    </ControlTemplate>
    <Style TargetType="DatePickerTextBox">
        <Setter Property="Background" Value="White" />
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Foreground" Value="{StaticResource InputForegroundBrush}" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="Padding" Value="5,4,5,4" />
        <Setter Property="SelectionBrush" Value="{StaticResource InputSelectionBrush}" />
        <!--<Setter Property="SelectionForeground" Value="{StaticResource InputSelectionForegroundBrush}" />-->
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DatePickerTextBox">
                    <Grid x:Name="Root">
                        <Grid.Resources>
                            <SolidColorBrush x:Key="WatermarkBrush" Color="#FFAAAAAA" />
                        </Grid.Resources>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                    <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled" />
                                <VisualState x:Name="ReadOnly" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="WatermarkStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Unwatermarked" />
                                <VisualState x:Name="Watermarked">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ContentElement" />
                                        <!--<DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity"
                                                Storyboard.TargetName="Watermark" />-->
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetName="FocusVisualElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2.5" Opacity="1">
                            <Grid x:Name="WatermarkContent">
                                <Border x:Name="ContentElement" BorderThickness="1" Padding="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                <!--<ContentControl x:Name="Watermark" Background="{TemplateBinding Background}"
                                        Content="{TemplateBinding Watermark}"
                                        Foreground="{StaticResource WatermarkBrush}"
                                        FontSize="{TemplateBinding FontSize}"
                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                        IsHitTestVisible="False" IsTabStop="False" Opacity="0" Padding="2"
                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                        Margin="{TemplateBinding Padding}" />-->
                            </Grid>
                        </Border>
                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="False" Margin="1" Opacity="0" RadiusX="1" RadiusY="1" Stroke="{StaticResource FocusVisualBrush}" StrokeThickness="{StaticResource FocusVisualStrokeThickness}" />
                        <Border x:Name="OuterHighlight" BorderBrush="{StaticResource ControlOuterHighlightBrush}" BorderThickness="0,0,1,1" CornerRadius="3" Margin="0,0,-1,-1" />
                        <Border x:Name="InnerShadowDark" BorderBrush="{StaticResource InnerShadowDarkBrush}" BorderThickness="1,1,0,0" CornerRadius="2" Margin="1" />
                        <Border x:Name="InnerShadowLight" BorderBrush="{StaticResource InnerShadowLightBrush}" BorderThickness="1,1,0,0" CornerRadius="1" Margin="2" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="DatePicker">
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Padding" Value="5,4,5,4" />
        <!--<Setter Property="SelectionBrush" Value="{StaticResource InputSelectionBrush}" />-->
        <!--<Setter Property="SelectionBackground" Value="{StaticResource InputSelectionBrush}" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DatePicker">
                    <Grid x:Name="Root">

                        <Grid.Resources>
                            <ControlTemplate x:Key="DropDownButtonTemplate" TargetType="Button">
                                <Grid FlowDirection="LeftToRight">
                                    <VisualStateManager.VisualStateGroups>
                                        <VisualStateGroup x:Name="CommonStates">
                                            <VisualStateGroup.Transitions>
                                                <VisualTransition GeneratedDuration="0" />
                                                <VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver" />
                                                <VisualTransition GeneratedDuration="0:0:0.1" To="Pressed" />
                                            </VisualStateGroup.Transitions>
                                            <VisualState x:Name="Normal" />
                                            <VisualState x:Name="MouseOver">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0" />
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Pressed">
                                                <Storyboard>
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="NormalElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0.25" />
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="PressedElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="1" />
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="MouseOverElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0" />
                                                    <DoubleAnimation Duration="0" Storyboard.TargetName="HighlightElement" Storyboard.TargetProperty="(FrameworkElement.Opacity)" To="0.5" />
                                                </Storyboard>
                                            </VisualState>
                                            <VisualState x:Name="Disabled" />
                                        </VisualStateGroup>
                                    </VisualStateManager.VisualStateGroups>
                                    <Grid Width="26" Height="24" VerticalAlignment="Top">
                                        <Border CornerRadius="1">
                                            <Border.Background>
                                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                    <GradientStop Color="#FFFFFFFF" Offset="0.65" />
                                                    <GradientStop Color="#FFF2F2F2" Offset="0.90" />
                                                    <GradientStop Color="#FFDADADA" Offset="1" />
                                                </LinearGradientBrush>
                                            </Border.Background>
                                            <Border.Effect>
                                                <DropShadowEffect Color="#55524f" ShadowDepth="2" BlurRadius="3" Opacity="0.5" />
                                            </Border.Effect>
                                        </Border>
                                        <Border x:Name="NormalElement" Height="6" VerticalAlignment="Top" CornerRadius="1,1,0,0" Background="{StaticResource ColorAccentBrush}" />
                                        <TextBlock Text="16" FontSize="14" Foreground="#FF292D2F" FontWeight="Bold" FontFamily="Arial" Margin="0,6,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" />
                                        <Border x:Name="MouseOverElement" Height="6" Background="{StaticResource ColorAccentOverBrush}" CornerRadius="2,2,0,0" Opacity="0" VerticalAlignment="Top" />
                                        <Border x:Name="PressedElement" Height="6" Background="{StaticResource ColorAccentSubduedBrush}" CornerRadius="2,2,0,0" Opacity="0" VerticalAlignment="Top" />
                                        <Border x:Name="HighlightElement" Height="6" BorderBrush="{StaticResource ColorAccentHighlightBrush}" BorderThickness="0.5,1,0,0" CornerRadius="1,1,0,0" VerticalAlignment="Top" />
                                        <Border x:Name="DisabledVisual" Background="{StaticResource DisabledBrush}" CornerRadius="1,1,0,0" Opacity="0" />
                                    </Grid>
                                </Grid>
                            </ControlTemplate>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisual" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="InvalidUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />

                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="InvalidFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ValidationErrorElement">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="IsOpen" Storyboard.TargetName="validationTooltip">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>True</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <DatePickerTextBox x:Name="TextBox" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="0" Height="28" Padding="{TemplateBinding Padding}" Foreground="{StaticResource ControlForeground}" SelectionBrush="{StaticResource InputSelectionForegroundBrush}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <!--SelectionBackground="{TemplateBinding SelectionBackground}"-->
                        <Border x:Name="ValidationErrorElement" BorderBrush="{StaticResource ErrorBrush}" BorderThickness="1" CornerRadius="3" Grid.Column="0" Visibility="Collapsed">
                            <ToolTipService.ToolTip>
                                <ToolTip x:Name="validationTooltip" DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" PlacementTarget="{Binding ElementName=TextBox}" Template="{StaticResource ValidationToolTipTemplate}">
                                    <!--<ToolTip.Triggers>
                                        <EventTrigger RoutedEvent="Canvas.Loaded">
                                            <BeginStoryboard>
                                                <Storyboard>
                                                    <ObjectAnimationUsingKeyFrames
                                                            Storyboard.TargetProperty="IsHitTestVisible"
                                                            Storyboard.TargetName="validationTooltip">
                                                        <DiscreteObjectKeyFrame KeyTime="0">
                                                            <DiscreteObjectKeyFrame.Value>
                                                                <System:Boolean>true</System:Boolean>
                                                            </DiscreteObjectKeyFrame.Value>
                                                        </DiscreteObjectKeyFrame>
                                                    </ObjectAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </EventTrigger>
                                    </ToolTip.Triggers>-->
                                </ToolTip>
                            </ToolTipService.ToolTip>
                            <Grid Background="Transparent" HorizontalAlignment="Right" Height="12" Margin="1,-4,-4,0" VerticalAlignment="Top" Width="12">
                                <Path Data="M 1,0 L6,0 A 2,2 90 0 1 8,2 L8,7 z" Fill="{StaticResource ErrorBrush}" Margin="1,3,0,0" />
                            </Grid>
                        </Border>
                        <Button x:Name="Button" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Foreground="{TemplateBinding Foreground}" Grid.Column="1" Margin="4,2,2,0" Template="{StaticResource DropDownButtonTemplate}" Width="26" />
                        <Grid x:Name="DisabledVisual" Grid.ColumnSpan="2" IsHitTestVisible="False" Opacity="0">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Rectangle Fill="{StaticResource DisabledBrush}" RadiusX="3" RadiusY="3" Margin="0,0,-1,-1" />
                            <Rectangle Grid.Column="1" Fill="{StaticResource DisabledBrush}" Height="26" Margin="4,0,2,0" RadiusX="1" RadiusY="1" Width="26" />
                        </Grid>
                        <Popup x:Name="Popup" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	*************************************************************************************
	Calendar (including CalendarItem, CalendarButton, and CalendarDayButton styles)
	*************************************************************************************
	-->

    <Style TargetType="CalendarDayButton">
        <Setter Property="Background" Value="{StaticResource HighlightBrushGreen}" />
        <Setter Property="FontSize" Value="9" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="MinWidth" Value="24" />
        <Setter Property="MinHeight" Value="20" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CalendarDayButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="OverBackground" Storyboard.TargetProperty="Opacity" To=".5" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="OverBackground" Storyboard.TargetProperty="Opacity" To=".5" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="OverBackground" Storyboard.TargetProperty="Opacity" To="0" Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="Content" Storyboard.TargetProperty="Opacity" To=".35" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="SelectedBackground" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                        <ColorAnimation Duration="0" To="White" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="Content" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CalendarButtonFocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="CalendarButtonFocused" />
                                <VisualState x:Name="CalendarButtonUnfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ActiveStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Active" />
                                <VisualState x:Name="Inactive">
                                    <Storyboard>
                                        <ColorAnimation Duration="0" To="#FF9C9DA0" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="Content" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="DayStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="RegularDay" />
                                <VisualState x:Name="Today">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="TodayBackground" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BlackoutDayStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="NormalDay" />
                                <VisualState x:Name="BlackoutDay">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="BlackoutVisual" Storyboard.TargetProperty="Opacity" To="0.55" Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Rectangle x:Name="TodayBackground" Opacity="0" Fill="#FFAAAAAA" RadiusX="1" RadiusY="1" />
                        <Rectangle x:Name="SelectedBackground" Opacity="0" Fill="{StaticResource InputSelectionBrush}" RadiusX="1" RadiusY="1" Effect="{StaticResource LightControlShadowEffect}" />
                        <Rectangle x:Name="OverBackground" Opacity="0" Fill="#2000" RadiusX="1" RadiusY="1" />

                        <ContentControl x:Name="Content" IsTabStop="False" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" FontSize="{TemplateBinding FontSize}" Margin="5,1,5,1" Foreground="#404040" />

                        <Path x:Name="BlackoutVisual" Opacity="0" Margin="3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" RenderTransformOrigin="0.5,0.5" Fill="{StaticResource DisabledBrush}" Stretch="Fill" Data="M8.1772461,11.029181 L10.433105,11.029181 L11.700684,12.801641 L12.973633,11.029181 L15.191895,11.029181 L12.844727,13.999395 L15.21875,17.060919 L12.962891,17.060919 L11.673828,15.256231 L10.352539,17.060919 L8.1396484,17.060919 L10.519043,14.042364 z" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="CalendarButton">
        <Setter Property="Background" Value="{StaticResource ControlBackgroundOverGreen}" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="MinWidth" Value="42" />
        <Setter Property="MinHeight" Value="40" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CalendarButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background" />
                                        <ColorAnimation Duration="0" To="{StaticResource ControlForegroundGreenColor}" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="Content" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Background" />
                                        <ColorAnimation Duration="0" To="{StaticResource ControlForegroundGreenColor}" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="Content" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Unselected" />
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To=".75" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedBackground" />
                                        <ColorAnimation Duration="0" To="{StaticResource ControlForegroundGreenColor}" Storyboard.TargetProperty="(Control.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="Content" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ActiveStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Active" />
                                <VisualState x:Name="Inactive">
                                    <Storyboard>
                                        <ColorAnimation Duration="0" To="#FF777777" Storyboard.TargetProperty="(ContentControl.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="Content" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="CalendarButtonFocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="CalendarButtonFocused" />
                                <VisualState x:Name="CalendarButtonUnfocused" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Unfocused" />
                                <VisualState x:Name="Focused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="SelectedBackground" Fill="{TemplateBinding Background}" Opacity="0" RadiusY="1" RadiusX="1" />
                        <Rectangle x:Name="Background" Fill="{TemplateBinding Background}" Opacity="0" RadiusY="1" RadiusX="1" />
                        <ContentControl x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="#FF333333" FontSize="{TemplateBinding FontSize}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Margin="1,0,1,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="CalendarItem">
        <Setter Property="FontWeight" Value="Normal" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CalendarItem">
                    <Grid Margin="4">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisual" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" CornerRadius="2" Background="{TemplateBinding Background}">
                            <Border.Effect>
                                <DropShadowEffect Color="#55524f" ShadowDepth="1" BlurRadius="4" Opacity="0.5" />
                            </Border.Effect>
                        </Border>
                        <Border x:Name="HeaderBackground" CornerRadius="2,2,0,0" Height="28" VerticalAlignment="Top" Background="{StaticResource StaticControlBackground}" />
                        <Grid>
                            <Grid.Resources>
                                <ControlTemplate x:Key="HeaderButtonTemplate" TargetType="Button">
                                    <Grid Cursor="Hand">
                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="MouseOver" />
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To=".5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Content" />
                                                    </Storyboard>
                                                </VisualState>
                                                <VisualState x:Name="Pressed" />
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="FocusStates">
                                                <VisualState x:Name="Unfocused" />
                                                <VisualState x:Name="Focused" />
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <ContentControl x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{StaticResource HeaderForegroundBrush}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" Margin="1,5,1,9" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                    </Grid>
                                </ControlTemplate>
                                <DataTemplate x:Name="DayTitleTemplate">
                                    <TextBlock FontWeight="Bold" FontSize="9" HorizontalAlignment="Center" Margin="0,4,0,4" Text="{Binding}" VerticalAlignment="Center" />
                                </DataTemplate>
                            </Grid.Resources>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Button x:Name="PreviousButton" HorizontalAlignment="Left" Style="{StaticResource OpacityButton}" Visibility="Collapsed" Width="30">
                                <Path Data="M1,0 L0,0.5 L1,1" Stretch="Fill" Fill="#404040" Width="5" Height="8" />
                            </Button>
                            <Button x:Name="HeaderButton" Grid.Column="1" HorizontalAlignment="Center" Template="{StaticResource HeaderButtonTemplate}" VerticalAlignment="Center" Margin="0,2,0,-2" />
                            <Button x:Name="NextButton" Grid.Column="2" HorizontalAlignment="Right" Style="{StaticResource OpacityButton}" Visibility="Collapsed" Width="30">
                                <Path Data="M0,0 L1,0.5 L0,1" Stretch="Fill" Fill="#404040" Width="5" Height="8" />
                            </Button>
                            <Grid x:Name="MonthView" Grid.ColumnSpan="3" Margin="6,6,6,6" Grid.Row="1">
                                <Grid.Resources>
                                    <Style TargetType="TextBlock">
                                        <Setter Property="Effect" Value="{x:Null}" />
                                        <Setter Property="FontSize" Value="9" />
                                        <Setter Property="Foreground" Value="#9fa3aa" />
                                    </Style>
                                </Grid.Resources>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                            </Grid>
                            <Grid x:Name="YearView" Grid.ColumnSpan="3" Margin="6,6,7,6" Grid.Row="1" Visibility="Collapsed">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="Auto" />
                                </Grid.RowDefinitions>
                            </Grid>
                        </Grid>
                        <Rectangle x:Name="DisabledVisual" Fill="{StaticResource DisabledBrush}" Opacity="0" RadiusY="2" RadiusX="2" Stretch="Fill" Stroke="{StaticResource DisabledBrush}" StrokeThickness="1" Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="Calendar">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="BorderBrush" Value="Transparent" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Calendar">
                    <StackPanel x:Name="Root" HorizontalAlignment="Center">
                        <CalendarItem x:Name="CalendarItem" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" />
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	GridSplitter
	***************************************************************************
	-->

    <Style TargetType="GridSplitter">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="IsTabStop" Value="true" />
        <Setter Property="Padding" Value="10,3" />
        <Setter Property="PreviewStyle">
            <Setter.Value>
                <Style TargetType="Control">
                    <Setter Property="Background" Value="#FF868686" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="Control">
                                <Grid x:Name="Root" Opacity=".5">
                                    <Rectangle Fill="{TemplateBinding Background}" />
                                    <Grid x:Name="HorizontalTemplate" Height="2" />
                                    <Grid x:Name="VerticalTemplate" Visibility="Collapsed" Width="2" />
                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="GridSplitter">
                    <Grid x:Name="Root" Background="{TemplateBinding Background}" IsHitTestVisible="{TemplateBinding IsEnabled}" d:DesignWidth="30" d:DesignHeight="30">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Root" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="HorizontalTemplate" Height="2" Visibility="Hidden" VerticalAlignment="Center">
                            <Rectangle Height="1" VerticalAlignment="Top">
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                        <GradientStop Offset="0" Color="#00000000" />
                                        <GradientStop Offset="0.2" Color="#80000000" />
                                        <GradientStop Offset="0.8" Color="#80000000" />
                                        <GradientStop Offset="1" Color="#00000000" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Rectangle Height="1" Margin="0,1,0,0">
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                        <GradientStop Offset="0" Color="#00FFFFFF" />
                                        <GradientStop Offset="0.2" Color="#80FFFFFF" />
                                        <GradientStop Offset="0.8" Color="#80FFFFFF" />
                                        <GradientStop Offset="1" Color="#00FFFFFF" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Grid>
                        <Grid x:Name="VerticalTemplate" Visibility="Visible" Width="2" Background="{x:Null}">
                            <Rectangle HorizontalAlignment="Left" Width="1">
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Offset="0" Color="#00000000" />
                                        <GradientStop Offset="0.2" Color="#80000000" />
                                        <GradientStop Offset="0.8" Color="#80000000" />
                                        <GradientStop Offset="1" Color="#00000000" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                            <Rectangle Margin="1,0,0,0" Width="1">
                                <Rectangle.Fill>
                                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                        <GradientStop Offset="0" Color="#00FFFFFF" />
                                        <GradientStop Offset="0.2" Color="#80FFFFFF" />
                                        <GradientStop Offset="0.8" Color="#80FFFFFF" />
                                        <GradientStop Offset="1" Color="#00FFFFFF" />
                                    </LinearGradientBrush>
                                </Rectangle.Fill>
                            </Rectangle>
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="ResizeDirection" Value="Rows">
                            <Setter Property="Visibility" TargetName="VerticalTemplate" Value="Hidden" />
                            <Setter Property="Visibility" TargetName="HorizontalTemplate" Value="Visible" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	DataGrid (including cell, row, column header and row header styles)
	***************************************************************************
	-->

    <ControlTemplate x:Key="DataGridCellTemplate" TargetType="{x:Type DataGridCell}">
        <Grid x:Name="Root" Background="{TemplateBinding Background}" Margin="{TemplateBinding Padding}">

            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CurrentStates">
                    <VisualState x:Name="Regular" />
                    <VisualState x:Name="Current">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisual" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="ValidationStates">
                    <VisualState x:Name="Valid" />
                    <VisualState x:Name="Invalid">
                        <Storyboard>
                            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="InvalidVisualElement" />
                            <ColorAnimation Duration="0" To="#FFFFFFFF" Storyboard.TargetProperty="(Fill).Color" Storyboard.TargetName="FocusVisual" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver" />
                </VisualStateGroup>
                <VisualStateGroup x:Name="SelectionStates">
                    <VisualState x:Name="Unselected" />
                    <VisualState x:Name="Selected" />
                </VisualStateGroup>
                <VisualStateGroup x:Name="FocusStates">
                    <VisualState x:Name="Unfocused" />
                    <VisualState x:Name="Focused" />
                </VisualStateGroup>
                <VisualStateGroup x:Name="InteractionStates">
                    <VisualState x:Name="Display" />
                    <VisualState x:Name="Editing">
                        <Storyboard>

                            <ThicknessAnimation BeginTime="00:00:00" Storyboard.TargetName="Content" Storyboard.TargetProperty="(FrameworkElement.Margin)" Duration="0:00:00" To="0" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Rectangle x:Name="FocusVisual" Fill="#66FFFFFF" HorizontalAlignment="Stretch" IsHitTestVisible="false" Opacity="0" VerticalAlignment="Stretch" />
            <!--<ContentPresenter />-->
            <ContentPresenter x:Name="Content" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
            <Rectangle x:Name="InvalidVisualElement" HorizontalAlignment="Stretch" IsHitTestVisible="False" Opacity="0" Stroke="{StaticResource ErrorBrush}" StrokeThickness="1" VerticalAlignment="Stretch" />
            <Rectangle x:Name="RightGridLine" Grid.Column="1" VerticalAlignment="Stretch" Width="1" Visibility="Hidden" />
        </Grid>
    </ControlTemplate>
    <Style TargetType="DataGridCell">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Padding" Value="0,3" />
        <Setter Property="Template" Value="{StaticResource DataGridCellTemplate}" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Foreground" Value="#454543" />

        <Setter Property="TextElement.FontFamily" Value="Trebuchet MS" />

    </Style>
    <Style x:Key="CenteredCell" TargetType="DataGridCell">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template" Value="{StaticResource DataGridCellTemplate}" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
    </Style>
    <Style x:Key="ColumnHeaderGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Width" Value="8" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Cursor" Value="SizeWE" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="DataGridColumnHeader">
        <Setter Property="Foreground" Value="White" />
        <Setter Property="HorizontalContentAlignment" Value="Left" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Padding" Value="4" />
        <Setter Property="SeparatorBrush" Value="#20FFFFFF" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGridColumnHeader">
                    <Grid x:Name="Root">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Pressed" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SortStates">
                                <VisualState x:Name="Unsorted" />
                                <VisualState x:Name="SortAscending">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SortIcon" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="SortDescending">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SortIcon" />
                                        <DoubleAnimation Duration="0" To="-.9" Storyboard.TargetProperty="(RenderTransform).ScaleY" Storyboard.TargetName="SortIcon" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="NormalElement" Grid.ColumnSpan="2" Background="{StaticResource DataGridHeaderBrush}" />
                        <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <ContentPresenter Content="{TemplateBinding Content}" />
                            <Path x:Name="SortIcon" Grid.Column="1" Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z " Fill="White" HorizontalAlignment="Left" Margin="4,0,0,0" Opacity="0" RenderTransformOrigin=".5,.5" Stretch="Uniform" VerticalAlignment="Center" Width="8">
                                <Path.RenderTransform>
                                    <ScaleTransform ScaleY=".9" ScaleX=".9" />
                                </Path.RenderTransform>
                            </Path>

                        </Grid>
                        <Border x:Name="VerticalSeparator" BorderBrush="#40000000" BorderThickness="1,0,0,0" Grid.Column="1" Visibility="{TemplateBinding SeparatorVisibility}">
                            <Rectangle Fill="{TemplateBinding SeparatorBrush}" VerticalAlignment="Stretch" Width="1" />
                        </Border>
                        <Thumb x:Name="PART_LeftHeaderGripper" HorizontalAlignment="Left" Grid.ColumnSpan="2" Style="{StaticResource ColumnHeaderGripperStyle}" />

                        <Thumb x:Name="PART_RightHeaderGripper" HorizontalAlignment="Right" Grid.ColumnSpan="2" Style="{StaticResource ColumnHeaderGripperStyle}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="RowHeaderGripperStyle" TargetType="{x:Type Thumb}">
        <Setter Property="Height" Value="8" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="Cursor" Value="SizeNS" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="DataGridRowHeader">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="SeparatorBrush" Value="#FFFFFFFF" />
        <Setter Property="SeparatorVisibility" Value="Collapsed" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGridRowHeader">
                    <Grid x:Name="Root">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CurrentRowGlyph" />
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="EditingRowGlyph" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver_CurrentRow_Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CurrentRowGlyph" />
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="EditingRowGlyph" />
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal_CurrentRow">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CurrentRowGlyph" />
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="EditingRowGlyph" />
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CurrentRowGlyph" />
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="EditingRowGlyph" />
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal_EditingRow">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CurrentRowGlyph" />
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="EditingRowGlyph" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused_EditingRow" />
                                <VisualState x:Name="MouseOver_CurrentRow" />
                                <VisualState x:Name="MouseOver_Unfocused_EditingRow" />
                                <VisualState x:Name="MouseOver_EditingRow" />
                                <VisualState x:Name="MouseOver_Unfocused_Selected" />
                                <VisualState x:Name="MouseOver_Selected" />
                                <VisualState x:Name="MouseOver_Unfocused_CurrentRow_Selected" />
                                <VisualState x:Name="Unfocused_Selected" />
                                <VisualState x:Name="Unfocused_CurrentRow_Selected" />
                                <VisualState x:Name="Normal_CurrentRow_Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="CurrentRowGlyph" />
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="EditingRowGlyph" />
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SelectedElement" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="RowValid" />
                                <VisualState x:Name="RowInvalid">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundRectangle" />
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="RowInvalidVisualElement" />

                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="#20000000" BorderThickness="0,0,1,0" Grid.ColumnSpan="2" Grid.RowSpan="3">
                            <Grid Background="{TemplateBinding Background}">
                                <Rectangle x:Name="RowInvalidVisualElement" Grid.ColumnSpan="2" Fill="{StaticResource ErrorBrush}" Opacity="0" Grid.RowSpan="3" Stretch="Fill" />
                                <Rectangle x:Name="BackgroundRectangle" Grid.ColumnSpan="2" Fill="Transparent" Grid.RowSpan="3" Stretch="Fill" />
                            </Grid>
                        </Border>
                        <Rectangle x:Name="SelectedElement" Fill="{DynamicResource HighlightBrushGreen}" Grid.ColumnSpan="2" Opacity="0" Grid.RowSpan="2" />
                        <ContentPresenter Content="{TemplateBinding Content}" Grid.Column="1" HorizontalAlignment="Center" Grid.RowSpan="2" VerticalAlignment="Center" />
                        <Path x:Name="CurrentRowGlyph" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Fill="White" HorizontalAlignment="Center" Height="10" Margin="8,0,8,0" Opacity="0" Grid.RowSpan="2" Stretch="Fill" VerticalAlignment="Center" Width="6" />
                        <Path x:Name="EditingRowGlyph" Data="F1 M 511.047,352.682L 511.047,342.252L 517.145,347.467L 511.047,352.682 Z " Fill="White" HorizontalAlignment="Center" Height="10" Margin="8,0,8,0" Opacity="0" Grid.RowSpan="2" Stretch="Fill" VerticalAlignment="Center" Width="6" d:IsHidden="True" />
                        <Thumb x:Name="PART_TopHeaderGripper" VerticalAlignment="Top" Grid.RowSpan="3" Style="{StaticResource RowHeaderGripperStyle}" />
                        <Thumb x:Name="PART_BottomHeaderGripper" VerticalAlignment="Bottom" Grid.RowSpan="3" Style="{StaticResource RowHeaderGripperStyle}" />
                        <Rectangle x:Name="HorizontalSeparator" Grid.ColumnSpan="2" Fill="{TemplateBinding SeparatorBrush}" HorizontalAlignment="Stretch" Height="1" Margin="1,0,1,0" Grid.Row="2" />

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="DataGridRow">
        <Setter Property="IsTabStop" Value="False" />

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="DataGridRow">
                    <Grid x:Name="Root" Background="{x:Null}">
                        <!--     <Grid.Resources>

                    <Style TargetType="TextBlock">
                        <Setter Property="Foreground" Value="White" />
                     </Style>

                     <Storyboard x:Key="DetailsVisibleTransition">
                        <DoubleAnimation Duration="00:00:0.1" Storyboard.TargetProperty="ContentHeight"
                              Storyboard.TargetName="DetailsPresenter" />
                     </Storyboard>
                  </Grid.Resources>-->
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" />
                                    <VisualTransition From="MouseOver" GeneratedDuration="0:0:0.1" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverElement" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal_AlternatingRow">

                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverElement" d:IsOptimized="True" />
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="AlternatingElement">
                                            <EasingDoubleKeyFrame KeyTime="0" Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>

                                </VisualState>

                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverElement" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Normal_Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectedElement" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver_Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectedElement" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused_Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectedElement" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused_Editing" />
                                <VisualState x:Name="Normal_Editing">

                                </VisualState>
                                <VisualState x:Name="MouseOver_Unfocused_Editing">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverElement" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver_Editing">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MouseOverElement" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="MouseOver_Unfocused_Selected">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SelectedElement" d:IsOptimized="True" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="ValidationStates">
                                <VisualState x:Name="Valid" />
                                <VisualState x:Name="Invalid">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="0.55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="InvalidVisualElement" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="AlternatingElement" Fill="{Binding AlternatingRowBackground, Mode=OneWay, RelativeSource={RelativeSource FindAncestor,AncestorType=DataGrid}}" Grid.ColumnSpan="2" Opacity="0" Grid.RowSpan="2" />
                        <Rectangle x:Name="MouseOverElement" Fill="{StaticResource DataGridMouseOverBrush}" Grid.ColumnSpan="2" Opacity="0" Grid.RowSpan="2" />
                        <!---->
				  
                  <Rectangle x:Name="SelectedElement" Fill="{StaticResource DataGridSelectedBrush}" 
                        Grid.ColumnSpan="2" Opacity="0" Grid.RowSpan="2" />
                  <Rectangle x:Name="InvalidVisualElement" Grid.ColumnSpan="2" Fill="{StaticResource ErrorBrush}"
                        Opacity="0" Grid.RowSpan="2" />
                  		
                  <DataGridRowHeader x:Name="RowHeader" Grid.RowSpan="3"
                        Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Row}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" />
                  <DataGridCellsPresenter x:Name="CellsPresenter" Grid.Column="1" Padding="2"
                        ItemsPanel="{TemplateBinding ItemsPanel}"  />
                  <DataGridDetailsPresenter x:Name="DetailsPresenter" Grid.Column="1" Grid.Row="1"
                        Visibility="{TemplateBinding DetailsVisibility}" />
                  <Rectangle x:Name="BottomGridLine" Grid.Column="1" HorizontalAlignment="Stretch" Height="1"
                        Grid.Row="2" />
               </Grid>
            	<ControlTemplate.Triggers>
            		<Trigger Property="ItemsControl.AlternationIndex" Value="0"/>
            	</ControlTemplate.Triggers>
            </ControlTemplate>
         </Setter.Value>
      </Setter>
   </Style>
   <ControlTemplate x:Key="TopLeftHeaderTemplate" TargetType="DataGridColumnHeader">
      <Border Background="{StaticResource DataGridHeaderBrush}" CornerRadius="2,0,0,0">
         <Border BorderBrush="{TemplateBinding SeparatorBrush}" BorderThickness="0,0,1,0" Grid.Column="1">
            <Rectangle Fill="#20000000" HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="1" />
         </Border>
      </Border>
   </ControlTemplate>
   <ControlTemplate x:Key="TopRightHeaderTemplate" TargetType="DataGridColumnHeader">
      <Border Background="{StaticResource DataGridHeaderBrush}" CornerRadius="0,2,0,0">
         <Border BorderBrush="#20000000" BorderThickness="1,0,0,0">
            <Rectangle Fill="{TemplateBinding SeparatorBrush}" HorizontalAlignment="Left" VerticalAlignment="Stretch"
                  Width="1" />
         </Border>
      </Border>
   </ControlTemplate>
   <Style TargetType="{x:Type DataGrid}">
      <Setter Property="helpers:DataGridCheckBoxColumnFixer.Fix" Value="True" />
      <Setter Property="AlternatingRowBackground" Value="#ECECEC" />
      <Setter Property="AutoGenerateColumns" Value="True" />
      <Setter Property="Background" Value="#F6F6F6" />
      <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
      <Setter Property="BorderThickness" Value="1" />
	  <Setter Property="TextElement.Foreground" Value="Black" />
      
      <Setter Property="CanUserReorderColumns" Value="True" />
      <Setter Property="CanUserResizeColumns" Value="True" />
      <Setter Property="CanUserSortColumns" Value="True" />
      <Setter Property="CellStyle" Value="{StaticResource ResourceKey={x:Type DataGridCell}}" />
      <Setter Property="GridLinesVisibility" Value="None" />
      <Setter Property="HeadersVisibility" Value="Column" />
      <Setter Property="HorizontalGridLinesBrush" Value="#20000000" />
      <Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
      <Setter Property="IsTabStop" Value="True" />
      <Setter Property="RowBackground" Value="#00FFFFFF" />
      <Setter Property="RowDetailsVisibilityMode" Value="VisibleWhenSelected" />
      <Setter Property="SelectionMode" Value="Extended" />
      <Setter Property="VerticalGridLinesBrush" Value="#20000000" />
      <Setter Property="VerticalScrollBarVisibility" Value="Auto" />
      <!--<Setter Property="DragIndicatorStyle">
         <Setter.Value>
            <Style TargetType="{x:Type DataGridColumnHeader}">
               <Setter Property="Foreground" Value="#7FFFFFFF" />
               <Setter Property="Template">
                  <Setter.Value>
                     <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
                        <Grid>
                           <VisualStateManager.VisualStateGroups>
                              <VisualStateGroup x:Name="SortStates">
                                 <VisualState x:Name="Unsorted" />
                                 <VisualState x:Name="SortAscending">
                                    <Storyboard>
                                       <DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="SortIcon" />
                                    </Storyboard>
                                 </VisualState>
                                 <VisualState x:Name="SortDescending">
                                    <Storyboard>
                                       <DoubleAnimation Duration="0" To="1.0" Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="SortIcon" />
                                       <DoubleAnimation Duration="0" To="-.9"
                                             Storyboard.TargetProperty="(RenderTransform).ScaleY"
                                             Storyboard.TargetName="SortIcon" />
                                    </Storyboard>
                                 </VisualState>
                              </VisualStateGroup>
                           </VisualStateManager.VisualStateGroups>
                           <Rectangle x:Name="BackgroundRectangle" Grid.ColumnSpan="2" Fill="#66808080" Stretch="Fill" />
                           <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                 Margin="{TemplateBinding Padding}"
                                 VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
                              <Grid.ColumnDefinitions>
                                 <ColumnDefinition />
                                 <ColumnDefinition Width="Auto" />
                              </Grid.ColumnDefinitions>
                              <ContentPresenter Content="{TemplateBinding Content}" />
                              <Path x:Name="SortIcon" Grid.Column="1"
                                    Data="F1 M -5.215,6.099L 5.215,6.099L 0,0L -5.215,6.099 Z " Fill="#7FFFFFFF"
                                    HorizontalAlignment="Left" Margin="4,0,0,0" Opacity="0"
                                    RenderTransformOrigin=".5,.5" Stretch="Uniform" VerticalAlignment="Center" Width="8">
                                 <Path.RenderTransform>
                                    <ScaleTransform ScaleY=".9" ScaleX=".9" />
                                 </Path.RenderTransform>
                              </Path>
                           </Grid>
                        </Grid>
                     </ControlTemplate>
                  </Setter.Value>
               </Setter>
            </Style>
         </Setter.Value>
      </Setter>-->
                        <!--<Setter Property="DropLocationIndicatorStyle">
         <Setter.Value>
            <Style TargetType="{x:Type DataGridColumnHeader}">
               <Setter Property="Background" Value="#FF3F4346" />
               <Setter Property="Width" Value="2" />
               <Setter Property="Template">
                  <Setter.Value>
                     <ControlTemplate TargetType="{x:Type DataGridColumnHeader}">
                        <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}"
                              Width="{TemplateBinding Width}" />
                     </ControlTemplate>
                  </Setter.Value>
               </Setter>
            </Style>
         </Setter.Value>
      </Setter>-->
                        <Setter Property="ItemsPanel">
                            <Setter.Value>
                                <ItemsPanelTemplate>
                                    <DataGridRowsPresenter x:Name="PART_RowsPresenter" IsItemsHost="True" />
                                </ItemsPanelTemplate>
                            </Setter.Value>
                        </Setter>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type DataGrid}">
                                    <Grid>

                                        <VisualStateManager.VisualStateGroups>
                                            <VisualStateGroup x:Name="CommonStates">
                                                <VisualState x:Name="Normal" />
                                                <VisualState x:Name="Disabled">
                                                    <Storyboard>
                                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement" />
                                                    </Storyboard>
                                                </VisualState>
                                            </VisualStateGroup>
                                            <VisualStateGroup x:Name="ValidationStates">
                                                <VisualState x:Name="Invalid" />
                                                <VisualState x:Name="Valid" />
                                            </VisualStateGroup>
                                        </VisualStateManager.VisualStateGroups>
                                        <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2.5">
                                            <ScrollViewer x:Name="DG_ScrollViewer" Focusable="false">
                                                <ScrollViewer.Template>
                                                    <ControlTemplate TargetType="{x:Type ScrollViewer}">
                                                        <Grid x:Name="Root">
                                                            <!--<Grid.Resources>
                           <ControlTemplate x:Key="TopLeftHeaderTemplate" TargetType="DataGridColumnHeader">
                              <Border Background="{StaticResource DataGridHeaderBrush}" CornerRadius="2,0,0,0">
                                 <Border BorderBrush="{TemplateBinding SeparatorBrush}" BorderThickness="0,0,1,0"
                                       Grid.Column="1">
                                    <Rectangle Fill="#20000000" HorizontalAlignment="Right" VerticalAlignment="Stretch"
                                          Width="1" />
                                 </Border>
                              </Border>
                           </ControlTemplate>
                           <ControlTemplate x:Key="TopRightHeaderTemplate" TargetType="DataGridColumnHeader">
                              <Border Background="{StaticResource DataGridHeaderBrush}" CornerRadius="0,2,0,0">
                                 <Border BorderBrush="#20000000" BorderThickness="1,0,0,0">
                                    <Rectangle Fill="{TemplateBinding SeparatorBrush}" HorizontalAlignment="Left"
                                          VerticalAlignment="Stretch" Width="1" />
                                 </Border>
                              </Border>
                           </ControlTemplate>
                        </Grid.Resources>-->
                                                            <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="Auto" />
                                                                <ColumnDefinition />
                                                                <ColumnDefinition Width="Auto" />
                                                            </Grid.ColumnDefinitions>
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto" />
                                                                <RowDefinition />
                                                                <RowDefinition Height="Auto" />
                                                                <RowDefinition Height="Auto" />
                                                            </Grid.RowDefinitions>

                                                            <Border x:Name="ColumnHeaderBackground" Background="{StaticResource DataGridHeaderBrush}" CornerRadius="2,2,0,0" Grid.ColumnSpan="3" MinHeight="28" />
                                                            <DataGridColumnHeader x:Name="TopLeftCornerHeader" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Template="{StaticResource TopLeftHeaderTemplate}" Width="22" />
                                                            <Button Command="{x:Static DataGrid.SelectAllCommand}" Focusable="false" Opacity="0" Style="{DynamicResource {ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}}" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" />
                                                            <DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.Column="1" />
                                                            <!--<DataGridColumnHeader x:Name="TopRightCornerHeader" Grid.Column="2"
                              Template="{StaticResource TopRightHeaderTemplate}" />-->
                                                            <Rectangle x:Name="ColumnHeadersAndRowsSeparator" Grid.ColumnSpan="3" Fill="#FFC9CACA" Height="1" StrokeThickness="1" VerticalAlignment="Bottom" Width="Auto" />
                                                            <!--<ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />-->
                                                            <!--<ScrollContentPresenter x:Name="PART_ScrollContentPresenter"
                              Grid.ColumnSpan="2" Grid.Row="1" />-->
                                                            <!--<DataGridRowsPresenter x:Name="PART_RowsPresenter" IsItemsHost="True"
                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.ColumnSpan="2"
                              Grid.Row="1">

                        </DataGridRowsPresenter>-->

                                                            <Border x:Name="BottomRightCorner" CornerRadius="0,0,2,0" Grid.Column="2" Grid.Row="2" />
                                                            <Border x:Name="BottomLeftCorner" CornerRadius="0,0,0,2" Grid.ColumnSpan="2" Grid.Row="2" />
                                                            <!--<ScrollBar x:Name="PART_VerticalScrollBar" Grid.Column="2" Margin="0" Orientation="Vertical" Grid.Row="1"
                        Width="18" />-->
                                                            <ScrollBar x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Width="18" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}" />
                                                            <Grid Grid.Column="1" Grid.Row="2">
                                                                <Grid.ColumnDefinitions>
                                                                    <ColumnDefinition Width="Auto" />
                                                                    <ColumnDefinition />
                                                                </Grid.ColumnDefinitions>
                                                                <Rectangle x:Name="FrozenColumnScrollBarSpacer" />
                                                                <!--<ScrollBar x:Name="PART_HorizontalScrollBar" Grid.Column="1" Height="18" Orientation="Horizontal" />-->

                                                            </Grid>
                                                            <ScrollBar x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Height="18" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}" />
                                                            <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="2" Grid.Row="1" />
                                                            <Border x:Name="ColumnHeaderBorder" CornerRadius="3,3,0,0" Grid.ColumnSpan="3" MinHeight="28" BorderBrush="#3f3f42" BorderThickness="1,1,1,0" Margin="0,-1,-1,1" />
                                                            <Border x:Name="OuterHighlight" BorderBrush="#40FFFFFF" BorderThickness="0,0,1,1" CornerRadius="3" Grid.ColumnSpan="3" Grid.RowSpan="4" Margin="0,0,-2,-2" />
                                                            <Border x:Name="InnerShadowDark" BorderBrush="#50505050" BorderThickness="1,0,0,0" CornerRadius="2" Grid.ColumnSpan="3" Grid.RowSpan="4" Margin="0" />
                                                            <Border x:Name="InnerShadowLight" BorderBrush="#20202020" BorderThickness="1,1,0,0" CornerRadius="1" Grid.ColumnSpan="3" Grid.RowSpan="4" Margin="1,0,1,1" />

                                                            <!--<ValidationSummary x:Name="ValidationSummary" Grid.ColumnSpan="3" MaxHeight="90"
                                        Grid.Row="3" />-->
                                                        </Grid>
                                                    </ControlTemplate>
                                                </ScrollViewer.Template>

                                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                                                <!--//PEUT ETRE Grid.Column="1"-->
                                            </ScrollViewer>
                                        </Border>
                                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="2.5" HorizontalAlignment="Stretch" Height="Auto" IsHitTestVisible="False" Opacity="0" VerticalAlignment="Stretch" Width="Auto" />
                                    </Grid>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	Label
	***************************************************************************
	-->

    <Style TargetType="Label">
        <Setter Property="Foreground" Value="{StaticResource HeaderForegroundBrush}" />
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="UseLayoutRounding" Value="True" />
        <Setter Property="Margin" Value="0,0,4,4" />
        <Setter Property="Effect" Value="{StaticResource HeaderTextEffect}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Label">
                    <ContentPresenter />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style x:Key="PagingTextBoxStyle" TargetType="TextBox">
        <Setter Property="BorderThickness" Value="0" />
        <Setter Property="Background" Value="{StaticResource InputBackgroundBrush}" />
        <!--<Setter Property="Foreground" Value="{StaticResource InputForegroundBrush}" />-->
        <Setter Property="Padding" Value="2" />
        <Setter Property="SelectionBrush" Value="{StaticResource InputSelectionBrush}" />
        <!--<Setter Property="SelectionBackground" Value="{StaticResource InputSelectionBrush}" />-->
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TextBox">
                    <Grid x:Name="RootElement">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation To="0.55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="ReadOnly">
                                    <Storyboard>
                                        <DoubleAnimation To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="ReadOnlyVisualElement" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2" Opacity="1">
                            <Grid>
                                <Border x:Name="ReadOnlyVisualElement" Background="{StaticResource ReadOnlyBrush}" Opacity="0" />
                                <ScrollViewer x:Name="ContentElement" BorderThickness="0" HorizontalAlignment="Left" IsTabStop="False" Padding="{TemplateBinding Padding}" VerticalAlignment="Center" />
                            </Grid>
                        </Border>
                        <Border x:Name="DisabledVisualElement" Background="{StaticResource DisabledBrush}" CornerRadius="2" IsHitTestVisible="False" Opacity="0" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- 
	***************************************************************************
	TabControl
	***************************************************************************
	-->

    <Style TargetType="TabItem">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Background" Value="{StaticResource DarkBackground}" />
        <Setter Property="BorderBrush" Value="{StaticResource DarkControlBorderBrush}" />
        <Setter Property="BorderThickness" Value="1,1,1,0" />
        <Setter Property="Padding" Value="16,4" />
        <!--<Setter Property="FontFamily" Value="Segoe UI" />
        <Setter Property="Foreground" Value="{StaticResource HeaderTextStyle}" />-->
        <Setter Property="Foreground" Value="{StaticResource NavigationForegroundColorBrush}" />
        <Setter Property="FontFamily" Value="{StaticResource ContentFontFamily}" />
        <Setter Property="FontSize" Value="{StaticResource ContentFontSize}" />

        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalAlignment" Value="Stretch" />
        <Setter Property="HorizontalAlignment" Value="Stretch" />
        <Setter Property="MinWidth" Value="5" />
        <Setter Property="MinHeight" Value="28" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabItem">
                    <Grid x:Name="Root" Margin="0,0,3,0">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="00:00:00.1" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">

                                </VisualState>
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="SelectionStates">
                                <VisualState x:Name="Unselected">
                                </VisualState>
                                <VisualState x:Name="Selected">

                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="border1" Height="1" VerticalAlignment="Bottom" Background="#4000" Visibility="Hidden" />

                        <Border x:Name="border" Padding="{TemplateBinding Padding}" Background="{StaticResource DarkBorder}" CornerRadius="2.5,2.5,0,0" BorderThickness="1,1,1,0" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Width="Auto" BorderBrush="White">
                            <ContentControl Foreground="#46FFFFFF" x:Name="HeaderTopSelected" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Content="{TemplateBinding Header}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" IsTabStop="False" />
                        </Border>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TabStripPlacement" Value="Bottom">
                            <Setter Property="CornerRadius" TargetName="border" Value="0,0,2.5,2.5" />
                            <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource DarkBorder}" />

                            <Setter Property="BorderThickness" TargetName="border" Value="1,0,1,1" />
                            <Setter Property="VerticalAlignment" TargetName="border1" Value="Top" />

                        </Trigger>
                        <Trigger Property="Selector.IsSelected" Value="True">

                            <Setter Property="Visibility" TargetName="border1" Value="Hidden" />
                            <Setter Property="Background" TargetName="border" Value="{DynamicResource DarkBackground}" />
                            <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource DarkBorder}" />
                            <Setter Property="Panel.ZIndex" TargetName="border" Value="2" />
                            <Setter Property="Foreground" TargetName="HeaderTopSelected" Value="White" />
                        </Trigger>
                    </ControlTemplate.Triggers>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="TabControl">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Background" Value="#FFFFFF" />
        <Setter Property="BorderBrush" Value="#404040" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="Padding" Value="5" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="TabControl">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="TemplateTop" Effect="{StaticResource LightControlShadowEffect}">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition x:Name="ColumnDefinition0" />
                                <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition x:Name="RowDefinition0" Height="Auto" />
                                <RowDefinition x:Name="RowDefinition1" Height="*" />
                            </Grid.RowDefinitions>
                            <TabPanel x:Name="TabPanelTop" Grid.Column="0" Grid.Row="0" IsItemsHost="True" Margin="0,0,0,-1" Panel.ZIndex="1" />
                            <Border x:Name="ContentPanel" Grid.Column="0" Grid.Row="1" MinHeight="10" MinWidth="10" Background="{StaticResource DarkBackground}" BorderBrush="{StaticResource DarkBorder}" CornerRadius="0,2.5,2.5,2.5" BorderThickness="1">
                                <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" Cursor="{TemplateBinding Cursor}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
                            </Border>

                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="TabStripPlacement" Value="Bottom">
                            <Setter Property="Grid.Row" TargetName="TabPanelTop" Value="1" />
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                            <Setter Property="Height" TargetName="RowDefinition0" Value="*" />
                            <Setter Property="Height" TargetName="RowDefinition1" Value="Auto" />
                            <Setter Property="Margin" TargetName="TabPanelTop" Value="0,-1,0,0" />
                            <Setter Property="CornerRadius" TargetName="ContentPanel" Value="2.5,2.5,2.5,0" />

                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Left">
                            <Setter Property="Grid.Row" TargetName="TabPanelTop" Value="0" />
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                            <Setter Property="Grid.Column" TargetName="TabPanelTop" Value="0" />
                            <Setter Property="Grid.Column" TargetName="ContentPanel" Value="1" />
                            <Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto" />
                            <Setter Property="Width" TargetName="ColumnDefinition1" Value="*" />
                            <Setter Property="Height" TargetName="RowDefinition0" Value="*" />
                            <Setter Property="Height" TargetName="RowDefinition1" Value="0" />
                            <Setter Property="Margin" TargetName="TabPanelTop" Value="2,2,0,2" />
                        </Trigger>
                        <Trigger Property="TabStripPlacement" Value="Right">
                            <Setter Property="Grid.Row" TargetName="TabPanelTop" Value="0" />
                            <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0" />
                            <Setter Property="Grid.Column" TargetName="TabPanelTop" Value="1" />
                            <Setter Property="Grid.Column" TargetName="ContentPanel" Value="0" />
                            <Setter Property="Width" TargetName="ColumnDefinition0" Value="*" />
                            <Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto" />
                            <Setter Property="Height" TargetName="RowDefinition0" Value="*" />
                            <Setter Property="Height" TargetName="RowDefinition1" Value="0" />
                            <Setter Property="Margin" TargetName="TabPanelTop" Value="0,2,2,2" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
    